package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.ProviderSchedule;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.mapper.ProviderScheduleMapper;
import com.ruoyi.system.service.IProviderScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProviderScheduleServiceImpl implements IProviderScheduleService {

    @Autowired
    private ProviderScheduleMapper scheduleMapper;

    @Override
    public List<ProviderSchedule> selectProviderScheduleList(ProviderSchedule schedule) {
        return scheduleMapper.selectProviderScheduleList(schedule);
    }

    @Override
    public List<ProviderSchedule> selectProviderScheduleByDate(Long providerId, java.util.Date scheduleDate) {
        return scheduleMapper.selectProviderScheduleByDate(providerId, scheduleDate);
    }

    @Override
    public int insertProviderSchedule(ProviderSchedule schedule) {
        return scheduleMapper.insertProviderSchedule(schedule);
    }

    @Override
    public int updateProviderSchedule(ProviderSchedule schedule) {
        return scheduleMapper.updateProviderSchedule(schedule);
    }

    @Override
    public int deleteProviderScheduleById(Long id) {
        return scheduleMapper.deleteProviderScheduleById(id);
    }

    @Override
    public int deleteProviderScheduleByIds(Long[] ids) {
        return 0;
    }

    @Override
    public int deleteProviderScheduleByIds(String ids) {
        Long[] idArray = Convert.toLongArray(ids);
        return scheduleMapper.deleteProviderScheduleByIds(idArray);
    }

}